package com.mjy.integrationtest.util;

public class MathUtil {

    private MathUtil() {}

    public static int randomInt(int upper) {

        return Double.valueOf(Math.random() * upper + "").intValue();
    }

    public static int randomInt(int lowwer, int upper) {

        return randomInt(upper - lowwer) + lowwer;
    }

    @SuppressWarnings("unchecked")
    public static <T> T randomObj(T... objects) {

        return objects[randomInt(objects.length)];
    }

}
